package br.net.woodstock.tickettoride.client.common;

import br.net.woodstock.rockframework.InitializationException;
import br.net.woodstock.tickettoride.client.TicketService;
import br.net.woodstock.tickettoride.client.TicketServiceFactory;
import br.net.woodstock.tickettoride.client.config.TicketConfig;
import br.net.woodstock.tickettoride.client.ws.jee.TicketServiceFactoryJEE;

public final class TicketClient {

	private static final TicketServiceFactory	FACTORY;

	static {
		try {
			FACTORY = new TicketServiceFactoryJEE(TicketConfig.getInstance().getServiceWSDL());
		} catch (Exception e) {
			throw new InitializationException(e);
		}
	}

	public TicketClient() {
		super();
	}

	public TicketService getService() {
		try {
			return TicketClient.FACTORY.getTicketService();
		} catch (Exception e) {
			throw new InitializationException(e);
		}
	}

}
